<template>
	<view class="page">
		<q-navbar :backgrounds="backgrounds" title="掌上冬枣" :isBack="false"></q-navbar>
		<view class="header"></view>
		<view class="container">
			<view class="firstBox">
				<view class="item-box" v-for="(v,i) in list" :key="i" :style="{
					background:`url(${v.icon}) no-repeat`,
					backgroundSize:'100% 100%'
				}">
					<view>{{v.name}}</view>
					<view>查看更多</view>
					<view>
						<img :src="require('@/static/images/back.png')" alt="">
					</view>
				</view>
			</view>
			<view class="menu-box">
				<view class="menu-item" v-for="(v,i) in menulist" :key="i">
					<view><img :src="v.icon" alt=""></view>
					<view>{{v.name}}</view>
				</view>
			</view>
			<view class="paBox">
				<view class="item-box" v-for="(v,i) in palist" :key="i" :style="{
					background:`url(${v.icon}) no-repeat`,
					backgroundSize:'100% 100%'
				}">
					<view>{{v.name}}</view>
					<view></view>
				</view>
			</view>
			<view>
				供需服务
			</view>
		</view>
		<q-tarBar :current="0" />
	</view>
</template>

<script>
	export default {
		components: {},
		props: {},
		data() {
			return {
				backgrounds: {
					backgroundColor: 'transparent'
				},
				list: [{
						name: '农事管理',
						icon: require('@/static/images/bg2.png')
					},
					{
						name: '病虫害分析',
						icon: require('@/static/images/bg3.png')
					},
					{
						name: '冬枣形式分析',
						icon: require('@/static/images/bg4.png')
					},
					{
						name: '图谱库',
						icon: require('@/static/images/bg1.png')
					},
				],
				menulist: [{
						name: '农资下行',
						icon: require('@/static/images/2.1@2x.png')
					},
					{
						name: '农产品上行',
						icon: require('@/static/images/2.2@2x.png')
					},
					{
						name: '金融服务',
						icon: require('@/static/images/2.3@2x.png')
					},
					{
						name: '灾害预警',
						icon: require('@/static/images/2.4@2x.png')
					}
				],
				palist: [{
						name: '找企业',
						icon: require('@/static/images/x2.png')
					},
					{
						name: '冷库信息',
						icon: require('@/static/images/x1.png')
					}
				]
			}
		},
		watch: {},
		// 必须要在onReady生命周期，因为onLoad生命周期组件可能尚未创建完毕
		onReady() {},
		onLoad(options) {},
		onShow() {},
		methods: {}
	}
</script>

<style lang="scss" scoped>
	.page {
		min-height: 100vh;
		width: 100vw;
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
		background-color: #f4f4f4;

		.header {
			background: url('~@/static/images/banner@2x.png') no-repeat;
			background-size: 100% auto;
			height: 450rpx;
			margin-top: -100rpx;
		}

		.container {
			flex: 1;
			display: flex;
			flex-direction: column;
			justify-content: flex-start;
			align-items: center;
			margin: -100rpx 40rpx 0;

			.firstBox {
				display: flex;
				flex-wrap: wrap;
				justify-content: space-between;
				background-color: #fff;
				border-radius: 25rpx;
				padding: 40rpx 20rpx;
				margin-bottom: 40rpx;

				.item-box {
					width: 50%;
					height: 192rpx;
					background-color: #ffae11;
					border-radius: 10rpx;
					border-top: 20rpx solid #fff;
					border-right: 20rpx solid #fff;
					display: flex;
					flex-direction: column;
					justify-content: center;
					padding-left: 20rpx;

					>view:first-child {
						font-size: 30rpx;
						font-weight: bold;
						font-stretch: normal;
						letter-spacing: -3rpx;
						color: #333333;
					}

					:nth-child(2) {
						font-size: 20rpx;
						font-weight: normal;
						font-stretch: normal;
						line-height: 37rpx;
						letter-spacing: 0rpx;
						color: #666666;
						opacity: 0.5;
					}

					>view:last-child {
						width: 29rpx;
						height: 29rpx;

						img {
							width: 100%;
							height: 100%;
						}
					}
				}

				:nth-child(even) {
					border-right: none;
				}
			}

			.menu-box {
				display: flex;
				justify-content: space-between;
				width: 100%;
				height: 195rpx;
				background-color: #ffffff;
				border-radius: 20rpx;
				margin-bottom: 40rpx;

				.menu-item {
					width: 25%;
					display: flex;
					flex-direction: column;
					align-items: center;
					justify-content: center;
					font-size: 28rpx;
					font-weight: normal;
					font-stretch: normal;
					line-height: 32rpx;
					letter-spacing: 0rpx;
					color: #434343;

					>view:first-child {
						width: 55rpx;
						height: 60rpx;
						margin-bottom: 20rpx;

						img {
							width: 100%;
							height: 100%;
						}
					}
				}
			}

			.paBox {
				display: flex;
				justify-content: space-between;
				width: 100%;
				margin-bottom: 40rpx;

				.item-box {
					width: 48%;
					height: 160rpx;
					display: flex;
					flex-direction: column;
					padding-left: 40rpx;
					padding-top: 40rpx;
					color: #fff;

					:first-child {
						width: 150rpx;
						padding-bottom: 10rpx;
						font-size: 30rpx;
						letter-spacing: 1.5rpx;
						color: #ffffff;
					}

					:last-child {
						width: 45rpx;
						height: 8rpx;
						background-color: #ffffff;
						border-radius: 3.31rpx;
					}
				}
			}

			>view:last-child {
				width: 100%;
				height: 180rpx;
				background-color: #4559d9;
				border-radius: 10rpx;
				background: url('~@/static/images/4@2x.png') no-repeat;
				background-size: 100% 100%;
				display: flex;
				align-items: center;
				justify-content: center;
				font-size: 48rpx;
				font-weight: bold;
				letter-spacing: 9.6rpx;
				color: #ffffff;
				box-shadow: 3.1rpx 3.9rpx 6.6rpx 1.4rpx #040404;
				margin-bottom: 10rpx;
			}
		}


	}
</style>